<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
  
$id=isset($_GET["id"])?$_GET["id"]:"0";
if($id!="0"){
    $T->Set("id",$id);
    $g_user=$T->db->query("select * from sys_user_togrp where gid=".$id)->fetch(PDO::FETCH_ASSOC);
    if($g_user){
        $T->Set("menu_id",$g_user["user_id"]);
    }
}
$a_sql="";
if(!ckAdm()){
	$a_sql=" and mech=".$_SESSION["school"]." ";
}
$T->SetBlock2("list","SELECT id,deptname FROM sys_department where 1=1 ".$a_sql." order by odx asc"
    ,array(array("block"=>"rp","pid"=>"id","sql"=>"select id,username,truename,department from sys_member where department=? order by inserttime")));
        
$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 